package com.raycloud.erp.omll.provider.controller;


import com.alibaba.fastjson.JSON;
import com.raycloud.erp.omll.data.entity.MulPlatformUser;
import com.raycloud.erp.omll.provider.service.PlatformBasisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 平台店铺信息表 前端控制器
 * </p>
 *
 * @author 枫伦
 * @since 2021-01-05
 */
@RestController
@RequestMapping("/mul-platform-user")
public class MulPlatformUserController {
    @Autowired
    PlatformBasisService platformBasisService;

    @Autowired
    AsyncService asyncService;

    @GetMapping("/test")
    public void method() {
        List<MulPlatformUser> list = platformBasisService.getAll();
        System.out.println(JSON.toJSONString(list));


        System.out.println("主线程 name -->" + Thread.currentThread().getName() + "start");
        Long startTime = System.currentTimeMillis();
        try {
            asyncService.doTaskB();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Long endTime = System.currentTimeMillis();
        System.out.println("主线程 name -->" + Thread.currentThread().getName() + "finish");
        System.out.println("主线程" + Thread.currentThread().getName() + "耗时：" + (endTime - startTime));
    }


}